package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

func Processor1(context *gin.Context) {
	fmt.Println("Processor1")
	context.Set("name", "tom")
}
func Processor2(context *gin.Context) {
	fmt.Println("Processor2")
	value, ok := context.Get("name")
	if !ok {
		fmt.Println("没有name字段")
		return
	}
	fmt.Println(value)
}
func main() {
	r := gin.Default()
	r.GET("/user", Processor1, Processor2)

	r.Run(":9000")
}

//Processor1
//Processor2
